import axios from "./axios";
import { processResponse } from "./util";
import request from '@/utils/request'

export default {
  fetchAgentList(query) {
    return processResponse(axios.get("/agent/query", { params: query}));
  },
  Continued(id,years,query) {
    return processResponse(axios.get("/agent/" + id + "/renew/" + years, { query }));
  },
  agentStartup(id,query) {
    return processResponse(axios.get("/agent/startup/" + id, { query }));
  },
  agentTermination(id,query) {
    return processResponse(axios.get("/agent/termination/" + id, { query }));
  },
  // 获得省
  regions(query) {
    return processResponse(axios.get("/regions/root", { query }));
  },
  // 获得城市
  city(value,query) {
    return processResponse(axios.get("/regions/" + value + "/children", { query }));
  },
  // 获得县
  county(value,query) {
    return processResponse(axios.get("/regions/" + value + "/children", { query }));
  },
  // 获得方案列表
  scheme(query) {
    return processResponse(axios.get("/scheme/query", { query }));
  },
  AgentAdd(query) {
    return processResponse(axios.post('/agent', query))
  },
  AgentLog(id, query) {
    return processResponse(axios.get('/log/query-agent-log/' + id), {query})
  },
  // 代理商编辑
  AgentManagementEdit(query) {
    return processResponse(axios.put("/agent", query));
  },
  // 获取代理商信息id编辑
  AgentManagementShow(id, query) {
    return processResponse(axios.get("/agent/" + id, { query }));
  },
    // 获取代理商信息id查看
  AgentManagementLook(id, query) {
    return processResponse(axios.get("/agent/" + id, { query }));
  },
    // 重置密码
  restPassword(query) {
    return processResponse(axios.post("/user/reset", query));
  },
  // 修改用户名和密码
  userPassword(query) {
    return processResponse(axios.post("/user/modify",  query ));
  },
  // 激活码解绑
  unbinging(id, query) {
    return processResponse(axios.get("/activation/unbinging/" + id, { query }));
  },
  // 激活码解绑
  activationDelete(id, query) {
    return processResponse(axios.delete("/activation/" + id, { query }));
  },
};
